﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace OpenComposite.EII.RepositoryUIs
{
	public partial class CreateNewUOM : Form
	{
		public CreateNewUOM()
		{
			InitializeComponent();
			this.DialogResult = DialogResult.None;
		}

		public string UnitOfMeasure
		{
			get { return txtUOM.Text; }
			set { txtUOM.Text = value; }
		}

		private void saveClose()
		{
			this.DialogResult = DialogResult.OK;
			Close();
		}

		private void tsbtnSave_Click(object sender, EventArgs e)
		{
			saveClose();
		}

		private void txtUOM_KeyUp(object sender, KeyEventArgs e)
		{
			if ( e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) {
				saveClose();
			}
		}
	}
}
